package weborb.gcf.command
{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	
	import mx.controls.Alert;
	import mx.rpc.IResponder;
	import mx.rpc.events.FaultEvent;
	
	import weborb.gcf.business.*;
	import weborb.gcf.control.Player_loginEvent;
	import weborb.gcf.vo.*;
	
	public class Player_loginCommand implements ICommand, IResponder
	{
		public function execute( event : CairngormEvent) : void
		{
			var loginEvent:Player_loginEvent = Player_loginEvent ( event );
			var delegate : PlayerDelegate = new PlayerDelegate( this );
			delegate.login(loginEvent.login,loginEvent.password);
		}
		
		public function result( event : Object ) : void
		{
			var returnValue:Player = event.result as Player;
		}
		
		public function fault( event : Object ) : void
		{
			var faultEvent : FaultEvent = FaultEvent( event );
			Alert.show( "Fault "+faultEvent.fault.faultString+" "+faultEvent.fault.faultDetail);
		}
	}
}